
CFLAGS-cm-y += -I.
CXXFLAGS += -Icommon -std=c++11

predirs-$(CMCONF) += \
	config

obj-cm-$(CMCONF) += config/cm_conf.o
obj-cm-cpp-$(CMCONF) += config/cm_conf_ex.o

predirs-$(CRYPTO) += \
	crypto

obj-cm-$(CRYPTO) += crypto/aeslib.o \
	crypto/cm_base64.o \
	crypto/ngx_md5.o \
	crypto/polaraes.o

predirs-$(CMNET) += \
	net/http \
	net/connect

CFLAGS-cm-$(CMNET) += \
	-Inet/http -Inet/connect

obj-cm-$(CMNET) += net/http/cm_http.o \
	net/connect/cm_conn_tcp.o \
	net/http/cm_conn_ws.o \
	net/http/cm_http_download.o \
	net/http/cm_http_upload.o \
	net/http/http_parser.o \
	net/connect/cm_conn_udp.o \
	net/connect/cm_broadcast.o \
	net/connect/cm_unixsocket.o

predirs-$(CMMISC) +=\
	misc misc/led

CFLAGS-cm-$(CMMISC) += \
	-Imisc -Imisc/led \
	-Inet \
	-Iutils

obj-cm-$(CMMISC) += \
	misc/cm_debug_out.o \
	misc/cm_fifo.o \
	misc/cm_flash_cfg.o \
	misc/cm_local_debug.o \
	misc/cm_suspend.o \
	misc/cm_sys.o \
	misc/cm_uart.o \
	misc/cm_wifi.o \
	misc/led/cm_led.o

obj-cm-cpp-$(CMMISC) += \
	misc/cm_uart_ex.o

predirs-$(CMUTILS) += \
	utils

obj-cm-$(CMUTILS) += \
	utils/cm_list.o \
	utils/cm_print.o \
	utils/cm_print_cc.o \
	utils/cm_time.o \
	utils/cm_utils.o \
	utils/jkbytes.o \
	utils/re_list.o \
	utils/rt_print.o

predirs-$(I18N) += \
	i18n

obj-cm-cpp-$(I18N) += \
	i18n/CMLanguageConfig.o

predirs-$(AUTOTEST) += \
	autotest

CXXFLAGS-cm-$(AUTOTEST) += \
	-Imisc

obj-cm-cpp-$(AUTOTEST) += \
	autotest/CMAutoTestCommand.o \
	autotest/CMCommandInstance.o \
	autotest/CMFifoHandler.o \
	autotest/CMTestKeyCommand.o

obj-demo-cpp-$(AUTOTEST) += \
	autotest/cmautotest.cpp

predirs-$(MSG) += \
	msg

CXXFLAGS-cm-$(MSG) += \
	-Ifuncs

obj-cm-cpp-$(MSG) += \
	msg/CMMsgTaskInterface.o \
	msg/CMMsgTaskManager.o

obj-demo-cpp-$(MSG) += \
	msg/cm_msg_task_test.cpp

predirs-$(FUNCS) += \
	funcs

CFLAGS-cm-$(FUNCS) += \
	-Iutils
obj-cm-$(FUNCS) += \
	funcs/cm_task.o

obj-cm-cpp-$(FUNCS) += \
	funcs/CMBacktraceSelf.o \
	funcs/CMBaseProcess.o \
	funcs/CMCommandLineParser.o \
	funcs/CMLock.o \
	funcs/CMObserver.o \
	funcs/CMTaskRunner.o \
	funcs/CMTimeout.o \
	funcs/CMSignalAction.o

obj-demo-cpp-$(FUNCS) += \
	funcs/cm_command_parse_test.cpp \
	funcs/cm_observer_test.cpp \
	funcs/CMBacktraceSelf_test.cpp
